package cn.zyq.demo.service.user;


import cn.zyq.demo.beans.sys.SysAdmin;
import cn.zyq.demo.beans.user.User;
import cn.zyq.demo.system.common.CacheService;
import cn.zyq.demo.system.common.PageParam;
import com.github.pagehelper.PageInfo;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

public interface UserService extends CacheService<User> {
    PageInfo<User> list(PageParam pageParam, SysAdmin admin);

    void add(User param, SysAdmin admin);

    void update(User param, SysAdmin admin);

    void del(String serviceID, SysAdmin admin);

    User detail(String serviceID, SysAdmin admin);

    User detail(String serviceID);

    User detailByID(Integer userID);

    User getLoginUser();

    User wxMaLogin(String code);

    /**
     * 获取用户手机哈
     *
     * @param code
     * @param loginUser
     * @return
     */
    Object getPhone(String code, User loginUser);

    /**
     * 更新用户头像昵称和性别等信息
     *
     * @param loginUser
     * @param user
     * @return
     */
    User updateInfo(User loginUser, User user);

    /**
     * 去更新用户的钱
     *
     * @param amount
     * @param userID
     * @return
     */
    int addWallet(BigDecimal amount, Integer userID);

    /**
     * 去更新用户的钱
     *
     * @param amount
     * @param userID
     * @return
     */
    int subWallet(BigDecimal amount, Integer userID);

    /**
     * 获取短信验证码
     * @param phone
     * @return
     */
    int smsCode(String phone);

    /**
     * 提现申请
     * @param param
     * @param loginUser
     * @param request
     * @return
     */
//    UserCash withdraw(UserCash param, User loginUser,HttpServletRequest request);

}
